<?php

namespace JsonLowCode\Form\Fields;

use JsonLowCode\UI\SfcLocal;
use JsonLowCode\Form\Abstract\FieldAbstract;

/**
 * @property SfcLocal $element
 */
class SfcLocalField extends FieldAbstract
{
    protected function booting(): void
    {
        $this->element = new SfcLocal();
    }

    /**
     * 组件视图
     * @param string $view
     * @param array $data
     * @return $this
     */
    public function view(string $view, array $data = []): static
    {
        $this->element->view($view, $data);
        return $this;
    }

    /**
     * @param $path
     * @return $this
     */
    public function path($path): static
    {
        $this->element->path($path);
        return $this;
    }
}
